Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / properties / jucer_FilePropertyComponent.cpp
blob969e135bb950e96c1e95d1f7f4cc4ab1c750dc15
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "../jucer_Headers.h"
27 #include "jucer_FilePropertyComponent.h"
30 //==============================================================================
31 FilePropertyComponent::FilePropertyComponent (const String& name,
32 const bool isDirectory,
33 const bool allowEditingOfFilename,
34 const String& fileBrowserWildcard)
35 : PropertyComponent (name)
37 addAndMakeVisible (filenameComp = new FilenameComponent (name,
38 File::nonexistent,
39 allowEditingOfFilename,
40 isDirectory,
41 false,
42 fileBrowserWildcard,
43 String::empty,
44 String::empty));
46 filenameComp->addListener (this);
49 FilePropertyComponent::~FilePropertyComponent()
51 deleteAllChildren();
54 void FilePropertyComponent::refresh()
56 filenameComp->setCurrentFile (getFile(), false);
59 void FilePropertyComponent::filenameComponentChanged (FilenameComponent*)
61 if (getFile() != filenameComp->getCurrentFile())
62 setFile (filenameComp->getCurrentFile());